var vueEditor = Vue.component("vue-editor", {
	  replace: true,
	  inherit: false,
	  template: "<textarea></textarea>",
	  props: {
		  height: {
			  type: Number,
		  	  default: function(){
		  		  return 260;
		  	  }
		  }
	  },
	  data: function(){
		  return {
			  
		  }
	  },
	  mounted: function() {
	    var me = this;
	    this.control = $(this.$el);
	    this.control.summernote({
	    	height: this.height,
	    	callbacks: {
		        onInit: function() {
		          //me.control.summernote("code", me.text);
		        },
		        onImageUpload: function(files) {
		            //上传图片到服务器，使用了formData对象，至于兼容性...据说对低版本IE不太友好
		            var formData = new FormData();
		            formData.append('file',files[0]);
		            $.ajax({
		                url : '/file/upload',//后台文件上传接口
		                type : 'POST',
		                data : formData,
		                processData : false,
		                contentType : false,
		                success : function(data) {
		                    me.control.summernote('insertImage',data.imageUrl,'img');
		                }
		            });
		        }
		    }
	    }).on("summernote.change", function() {
	    	me.$emit('input', me.control.val());
	    });
	    
	  }
	});